home *** CD-ROM | disk | FTP | other *** search
/ Agent Central Host Computer / Agent - Central Host Computer.iso / _SETUP.1 / vsurvey.sql < prev    next >
Text File  |  2000-05-12  |  1KB  |  31 lines

  1. /*
  2. This view gathers the ridership survey information with run, route, trip data.
  3. It utilizes the context method to access the data.
  4. */
  5. create or replace view vsurvey as
  6. select trunc(driver_context.rte_date) survey_day, 
  7.     driver_context.route_id, 
  8.     driver_context.run_id, 
  9.     driver_context.trip_id, 
  10.     operator_context.user_id,
  11.     fare_context.fare_context_id, 
  12.     trips.direction1, 
  13.     trips.direction2, 
  14.     trips.dep_time,
  15.     trips.mileage,
  16.     trips.route_desc, 
  17.     operator_context.farebox_glid,
  18.     bus_id, 
  19.     fareentr.fare_id, 
  20.     fareentr.conv_date
  21. from fare_context, driver_context, operator_context, trips, bus, farebox, fareentr
  22. where    trips.id = driver_context.trip_id and
  23.     trips.runid = driver_context.run_id and 
  24.     trips.routeid = driver_context.route_id and
  25. fare_context.driver_context_id = driver_context.driver_context_id and driver_context.op_context_id = operator_context.op_context_id and
  26. fare_context.fare_context_id = fareentr.fare_context_id(+) and 
  27. operator_context.farebox_glid = farebox.glid and
  28. bus.glid = farebox.location;
  29.  
  30.  
  31.